leak fix and cleanup for gdb.
authortsteven4@gmail.com <tsteven4@gmail.com@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sun, 5 Jan 2014 23:16:21 +0000 (23:16 +0000)
committertsteven4@gmail.com <tsteven4@gmail.com@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sun, 5 Jan 2014 23:16:21 +0000 (23:16 +0000)
git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4713 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/gdb.cc
gpsbabel/test-all

index af9cf1a24e547b2ae3669747603b50f9562278f5..32f227b1acff93af6644518549236d3c2c463247 100644 (file)
@@ -1849,26 +1849,18 @@ static void
 write_route_cb(const route_head* rte)
 {
   gbfile* fsave;
-  char buf[32];
 
   if (ELEMENTS(rte) <= 0) {
     return;
   }
 
-  String tname;
-  if (rte->rte_name == NULL) {
-    snprintf(buf, sizeof(buf), "Route%04d", rte->rte_num);
-    tname = mkshort(short_h, buf);
+  QString name;
+  if (rte->rte_name.isNull()) {
+    name = mkshort(short_h, QString().sprintf("Route%04d", rte->rte_num));
   } else {
-    tname = mkshort(short_h, rte->rte_name);
+    name = mkshort(short_h, rte->rte_name);
   }
 
-  QString name(tname);
-#if NEW_STRINGS
-#else
-  xfree(tname);
-#endif
-
   rte_ct++;    /* increase informational number of written routes */
 
   fsave = fout;
@@ -1881,26 +1873,18 @@ static void
 write_track_cb(const route_head* trk)
 {
   gbfile* fsave;
-  char buf[32];
 
   if (ELEMENTS(trk) <= 0) {
     return;
   }
 
-  String tname; 
-  if (trk->rte_name == NULL) {
-    snprintf(buf, sizeof(buf), "Track%04d", trk->rte_num);
-    tname = mkshort(short_h, buf);
+  QString name; 
+  if (trk->rte_name.isNull()) {
+    name = mkshort(short_h, QString().sprintf("Track%04d", trk->rte_num));
   } else {
-    tname = mkshort(short_h, trk->rte_name);
+    name = mkshort(short_h, trk->rte_name);
   }
 
-  QString name(tname);
-#if NEW_STRINGS
-#else
-  xfree(tname);
-#endif
-
   trk_ct++;    /* increase informational number of written tracks */
 
   fsave = fout;
index 298c5de3f4aed9c180d6d236302e1c65073327d5..18ac264fb3c7a58269f29a769f70f26db5d96ffd 100755 (executable)
@@ -55,9 +55,9 @@ function try_run() # command line
     local RES=0
     local SEVERITY=""
     
-    [ $vg -ne 0 ] && CMD="valgrind -q $CMD"
+    [ $vg -ne 0 ] && CMD="valgrind --error-exitcode=125 --leak-check=full --show-reachable=yes --suppressions=gpsbabel.supp --log-fd=3 $CMD"
 
-    ${CMD} > $TEMPDIR/.result 2>&1
+    ${CMD} > $TEMPDIR/.result 2>&1 3>>vg.log
     RES=$?
     if [ $RES -ne 0 -o -s $TEMPDIR/.result ]; then
         if [ $RES -ne 0 ]; then